<template>
  <div class="exception">
    <img :src="getImageUrl(404)" />
    <el-button class="btn-home" @click="goHome">回到上一个页面</el-button>
  </div>
</template>

<script setup lang='ts'>
import { ref, reactive } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

const getImageUrl = (name: string) => {
  return new URL(`../assets/images/${name}.png`, import.meta.url).href;
};

const goHome = () => {
  return router.go(-2);
};
</script>

<style scoped>
.exception {
  position: relative;
}
.exception img {
  width: 100%;
  height: 100vh;
}
.exception .btn-home {
  position: absolute;
  left: 50%;
  bottom: 100px;
  margin-left: -34px;
}
</style>